package com.zzz.mylibrary.util;

import android.content.Context;
import com.tencent.mmkv.MMKV;

/**
 * Created by zhaojh on date 2020/3/12
 */
public class SpMMKV {
    
    //传入context时不能在application使用
    public static void init(Context context){
        MMKV.initialize(context);
    }
    
    public static void putValue(String key, String value) {
        MMKV kv = MMKV.defaultMMKV();
        kv.encode(key, value);
    }
    
    public static String getValue(String key) {
        MMKV kv = MMKV.defaultMMKV();
        return kv.decodeString(key);
    }
    
    
}
